﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using DevExpress.XtraBars.Ribbon;
using System.Configuration;

namespace UI
{
    public partial class QueryForm : RibbonForm
    {
        public QueryForm()
        {
            InitializeComponent();
        }
        private void skinRibbonGalleryBarItem1_GalleryItemClick(object sender, GalleryItemClickEventArgs e)
        {
            string caption = string.Empty;

            if (skinRibbonGalleryBarItem1.Gallery == null) return;

            caption = skinRibbonGalleryBarItem1.Gallery.GetCheckedItems()[0].Tag.ToString();//获取真实的名称，没有汉化的

            Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            configuration.AppSettings.Settings["SkinString"].Value = caption;
            configuration.Save(ConfigurationSaveMode.Modified);
            ConfigurationManager.RefreshSection("AppSettings");
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            string Topic = ConfigurationManager.AppSettings["SkinString"];
            defaultLookAndFeel1.LookAndFeel.SetSkinStyle(Topic);//设置主题样式
        }
    }
}
